<?php
namespace app\api\model;
use think\Model;

class TeamOutlay extends Model{
    protected $type = [
        'id'            =>'integer',
        'type'            =>'integer',
        'is_review'    =>  'integer',
        'cost_price'  => 'float',
        'num'    =>  'integer',
    ];
    //关联支出表
    public function supplier(){
        return $this->hasOne('supplier','id','supplier_id');
    }
    public function kind(){
        return $this->hasOne('category','id','kind_id');
    } 
    public function payments(){
        return $this->hasMany('payment','outlay_id','id');
    } 
    public function team(){
        return $this->hasOne('Team','id','parent_id');
    }
    public function salesman(){
        return $this->hasOne('manager','id','salesman_id');
    } 
    public function inInvoices(){
        return $this->hasMany('InInvoices','income_id','id');
    }
}